<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Dcat\Admin\Traits\HasDateTimeFormatter;

class Tag extends Model
{
	use HasDateTimeFormatter; 
    public $fillable = ['name','show'];

    public function videos(){
        return $this->belongsToMany(Video::class);
    }
    //局部作用域--是否显示
	public function scopeShow($query){
        return $query->where('show', 1);
    }
}
